import requests

headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36',
    'Referer': 'https://www.xiaohua.com/',
    'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
}
# 传递表单数据
data = {
    'username': 'luckyboy',
    'password': 'luckyboy'
}
session = requests.Session()
url = 'https://www.xiaohua.com/Handler/Login.ashx'
# 只用于登录 来获取登录后的cookie
session.post(url, headers=headers, data=data)
hot = 'https://www.xiaohua.com/hot/'
res = session.get(hot, headers=headers)
print(res.content.decode())
